<#macro material_submenu>
<#-- Add items to submenu -->
<ul class="dropdown-menu">
    <#if materials_titles?has_content>
        <#assign currentSectionTitle = "xxx">
        <#list materials_titles as section_title>
            <#if section_title.getSectionTitle()?string == "">
                <li>
                    <a href="${baseUrl}/material/view/?material_id=${section_title.getId()}">${section_title.getTitle()}</a>
                </li>
            </#if>
            <#if (currentSectionTitle != section_title.getSectionTitle()?string && section_title.getSectionTitle()?string != "")>
                <li class="dropdown-submenu">
                    <a href="#">${section_title.getSectionTitle()}</a>
                    <ul class="dropdown-menu">
                        <#list materials_titles as title>
                            <#if (section_title.getSectionTitle() == title.getSectionTitle())>
                                <li>
                                    <a href="${baseUrl}/material/view/?material_id=${title.getId()}">${title.getTitle()}</a>
                                </li>
                            </#if>
                        </#list>
                    </ul>
                </li>
            </#if>
            <#assign currentSectionTitle = section_title.getSectionTitle()?string>
        </#list>
    <li class="divider"></li>
    <li><a href="${syllabusLink}">${i18n.material.syllabus!"Syllabus"}</a></li>
    </#if>
</ul>
</#macro>
